linux磁盘分区方法 |
您所在的位置:网站首页 › linux 分区方法 › linux磁盘分区方法 |
产品型号:Thinkpad E15 系统版本:centos8 案例:在sdb盘上建一个分区,大小为1G 在虚拟机上添加一块硬盘 例:对sdb这块盘划分一个100M的分区出来 [root@xuegod63 ~]# fdisk /dev/sdb ... Command (m for help): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition 删除分区 g create a new empty GPT partition table G create an IRIX (SGI) partition table l list known partition types 显示分区类型 m print this menu 打印帮助菜单 n add a new partition 添加新的分区 o create a new empty DOS partition table p print the partition table 显示分区表 q quit without saving changes 不保存,退出 s create a new empty Sun disklabel t change a partition's system id 改变分区类型 u change display/entry units v verify the partition table w write table to disk and exit 写分区表信息到硬盘,保存操作并退出 x extra functionality (experts only) Command (m for help): p -----打印分区表 Command (m for help): n ----新建一个分区 Partition type: p primary (2 primary, 0 extended, 2 free) p:主分区 e extended e:扩展分区 Select (default p): --#直接默认 Using default response p Partition number (1,4, default 1): ---#直接默认 First sector (1230848-41943039, default 1230848): ---#直接默认 Using default value 1230848 Last sector, +sectors or +size{K,M,G} (1230848-41943039, default 41943039): +1G #输入分区大小 Partition 3 of type Linux and of size 1 GiB is set Command (m for help): w #保存退出 格式化并创建文件系统 [root@xuegod63 ~]# mkfs.xfs /dev/sdb1 注:-f 参数可以对已经存在文件系统的分区,强制格式化 [root@xuegod63 ~]# mkdir /sdb1 #创建挂载点 [root@xuegod63 ~]# mount /dev/sdb1 /sdb1/ #挂载 [root@xuegod63 ~]# df -h #查看 声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:0731-84117792 E-MAIL:[email protected] |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |